
		

-- D:\GOA\reslibrary\templete\res\modal\modalmgr.xsl 58
gr_module("gm_xinbanchunzhongyun")


mcgftraderecordmgr = inherit(GmSql.list,GmBase.CallBack):name("mcgftraderecordmgr")



mcgftraderecordmgr.init = function (self,pagecount)

	local top = self
	
	
	GmSql.list.init(self,gInfo["path"]..'/'..g_local_db_name,'czy_traderecord')
	GmBase.CallBack.init(self)
	
	self.baseurl = ''

	self.idPair = {}
	self.idPair['prev'] = '0'
	self.idPair['next'] = '0'
	
	self.pageCount = pagecount or 10
	self.totalPage = 0
	
	self:reset_maxminid('czy_traderecord','id')
	
	
	self.action = {}
	self.op  = {}
	
	
	
	-----------------------------
	self.action['cgftraderecordpost'] = {} 	
	-------
	self.op['cgftraderecordpost'] = function(postparam,ui)
	
		local net = GmBase.czynet.get_instance()		
		local newpostparam = {}
		local tbname,callbackey,newpostparam = net:cgftraderecordpost()
		for a,b in pairs(top.action['cgftraderecordpost']) do
			if postparam[a] ~= nil then
				newpostparam[a] = postparam[a]
			end
		end
		net:add_callback(callbackey,ui)	
		local tb,callbackey = net:cgftraderecordpost(newpostparam)
		
	end	
		
  self.action['cgftraderecordpost']['id'] = { ['title'] = '编号' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['trade_code'] = { ['title'] = '璐㈠姟娴佹按璐︾紪鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordpost']['customer_id'] = { ['title'] = 'customer_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['user_id'] = { ['title'] = 'user_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['supplier_id'] = { ['title'] = 'supplier_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['finance_order_group_id'] = { ['title'] = 'finance_order_group_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['sell_id'] = { ['title'] = '鏉愭枡閿€鍞叧鑱?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['purchase_id'] = { ['title'] = '閲囪喘妯″潡-閲囪喘鍗昳d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['purchase_order_id'] = { ['title'] = '閽堝閲囪喘璁㈠崟鐨勪粯娆?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['record_group_id'] = { ['title'] = '浠撳簱鎵归噺鎿嶄綔缁刬d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['last_money_account'] = { ['title'] = '閾惰璐﹀彿鏈熷垵' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordpost']['money'] = { ['title'] = 'money' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordpost']['next_money_account'] = { ['title'] = '閾惰璐︽埛鏈熸湯' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordpost']['discount'] = { ['title'] = '鎶樻墸' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordpost']['preferential'] = { ['title'] = '浼樻儬' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordpost']['is_from_customer_account'] = { ['title'] = 'is_from_customer_account' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordpost']['is_recharge'] = { ['title'] = '鏄惁鏄厖鍊艰褰?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordpost']['money_name'] = { ['title'] = 'money_name' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordpost']['money_type'] = { ['title'] = 'in:鍏ヨ处锛沷ut:鍑鸿处锛泃ransfer:杞处锛?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordpost']['money_project_id'] = { ['title'] = '鐢ㄤ簬鍏朵粬鏀跺叆鏀嚭鍒嗙被' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['system_account_id'] = { ['title'] = 'system_account_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['create_time'] = { ['title'] = '浠樻鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordpost']['receiver'] = { ['title'] = 'receiver' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordpost']['payer'] = { ['title'] = '浠樻浜猴紝鍙互鎵嬪～' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordpost']['handler_uid'] = { ['title'] = 'handler_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['voucher'] = { ['title'] = '鍑瘉鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '255' }	
  self.action['cgftraderecordpost']['status'] = { ['title'] = '1琛ㄧず鏈彈鐞嗭紝2琛ㄧず宸插彈鐞?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '1' }	
  self.action['cgftraderecordpost']['assignee_uid'] = { ['title'] = 'assignee_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordpost']['account_before_money'] = { ['title'] = '涓婃浠樻閲戦' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '18' }	
  self.action['cgftraderecordpost']['fill_time'] = { ['title'] = '鍒涘缓鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordpost']['accepter'] = { ['title'] = '鎽樿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }
  self.action['cgftraderecordpost']['list_source'] = { ['title'] = '' ,['t'] = 's' , ['max'] = 50 }
	
	-----------------------------
	self.action['cgftraderecorditem'] = {} 	
	-------
	self.op['cgftraderecorditem'] = function(postparam,ui)
	
		local net = GmBase.czynet.get_instance()		
		local newpostparam = {}
		local tbname,callbackey,newpostparam = net:cgftraderecorditem()
		for a,b in pairs(top.action['cgftraderecorditem']) do
			if postparam[a] ~= nil then
				newpostparam[a] = postparam[a]
			end
		end
		net:add_callback(callbackey,ui)	
		local tb,callbackey = net:cgftraderecorditem(newpostparam)
		
	end	
		
  self.action['cgftraderecorditem']['id'] = { ['title'] = '编号' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['trade_code'] = { ['title'] = '璐㈠姟娴佹按璐︾紪鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorditem']['customer_id'] = { ['title'] = 'customer_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['user_id'] = { ['title'] = 'user_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['supplier_id'] = { ['title'] = 'supplier_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['finance_order_group_id'] = { ['title'] = 'finance_order_group_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['sell_id'] = { ['title'] = '鏉愭枡閿€鍞叧鑱?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['purchase_id'] = { ['title'] = '閲囪喘妯″潡-閲囪喘鍗昳d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['purchase_order_id'] = { ['title'] = '閽堝閲囪喘璁㈠崟鐨勪粯娆?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['record_group_id'] = { ['title'] = '浠撳簱鎵归噺鎿嶄綔缁刬d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['last_money_account'] = { ['title'] = '閾惰璐﹀彿鏈熷垵' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorditem']['money'] = { ['title'] = 'money' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorditem']['next_money_account'] = { ['title'] = '閾惰璐︽埛鏈熸湯' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorditem']['discount'] = { ['title'] = '鎶樻墸' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorditem']['preferential'] = { ['title'] = '浼樻儬' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorditem']['is_from_customer_account'] = { ['title'] = 'is_from_customer_account' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecorditem']['is_recharge'] = { ['title'] = '鏄惁鏄厖鍊艰褰?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecorditem']['money_name'] = { ['title'] = 'money_name' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorditem']['money_type'] = { ['title'] = 'in:鍏ヨ处锛沷ut:鍑鸿处锛泃ransfer:杞处锛?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorditem']['money_project_id'] = { ['title'] = '鐢ㄤ簬鍏朵粬鏀跺叆鏀嚭鍒嗙被' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['system_account_id'] = { ['title'] = 'system_account_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['create_time'] = { ['title'] = '浠樻鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorditem']['receiver'] = { ['title'] = 'receiver' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecorditem']['payer'] = { ['title'] = '浠樻浜猴紝鍙互鎵嬪～' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecorditem']['handler_uid'] = { ['title'] = 'handler_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['voucher'] = { ['title'] = '鍑瘉鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '255' }	
  self.action['cgftraderecorditem']['status'] = { ['title'] = '1琛ㄧず鏈彈鐞嗭紝2琛ㄧず宸插彈鐞?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '1' }	
  self.action['cgftraderecorditem']['assignee_uid'] = { ['title'] = 'assignee_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorditem']['account_before_money'] = { ['title'] = '涓婃浠樻閲戦' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '18' }	
  self.action['cgftraderecorditem']['fill_time'] = { ['title'] = '鍒涘缓鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorditem']['accepter'] = { ['title'] = '鎽樿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }
  self.action['cgftraderecorditem']['list_source'] = { ['title'] = '' ,['t'] = 's' , ['max'] = 50 }
	
	-----------------------------
	self.action['cgftraderecordmodify'] = {} 	
	-------
	self.op['cgftraderecordmodify'] = function(postparam,ui)
	
		local net = GmBase.czynet.get_instance()		
		local newpostparam = {}
		local tbname,callbackey,newpostparam = net:cgftraderecordmodify()
		for a,b in pairs(top.action['cgftraderecordmodify']) do
			if postparam[a] ~= nil then
				newpostparam[a] = postparam[a]
			end
		end
		net:add_callback(callbackey,ui)	
		local tb,callbackey = net:cgftraderecordmodify(newpostparam)
		
	end	
		
  self.action['cgftraderecordmodify']['id'] = { ['title'] = '编号' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['trade_code'] = { ['title'] = '璐㈠姟娴佹按璐︾紪鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordmodify']['customer_id'] = { ['title'] = 'customer_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['user_id'] = { ['title'] = 'user_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['supplier_id'] = { ['title'] = 'supplier_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['finance_order_group_id'] = { ['title'] = 'finance_order_group_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['sell_id'] = { ['title'] = '鏉愭枡閿€鍞叧鑱?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['purchase_id'] = { ['title'] = '閲囪喘妯″潡-閲囪喘鍗昳d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['purchase_order_id'] = { ['title'] = '閽堝閲囪喘璁㈠崟鐨勪粯娆?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['record_group_id'] = { ['title'] = '浠撳簱鎵归噺鎿嶄綔缁刬d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['last_money_account'] = { ['title'] = '閾惰璐﹀彿鏈熷垵' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordmodify']['money'] = { ['title'] = 'money' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordmodify']['next_money_account'] = { ['title'] = '閾惰璐︽埛鏈熸湯' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordmodify']['discount'] = { ['title'] = '鎶樻墸' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordmodify']['preferential'] = { ['title'] = '浼樻儬' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordmodify']['is_from_customer_account'] = { ['title'] = 'is_from_customer_account' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordmodify']['is_recharge'] = { ['title'] = '鏄惁鏄厖鍊艰褰?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordmodify']['money_name'] = { ['title'] = 'money_name' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordmodify']['money_type'] = { ['title'] = 'in:鍏ヨ处锛沷ut:鍑鸿处锛泃ransfer:杞处锛?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordmodify']['money_project_id'] = { ['title'] = '鐢ㄤ簬鍏朵粬鏀跺叆鏀嚭鍒嗙被' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['system_account_id'] = { ['title'] = 'system_account_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['create_time'] = { ['title'] = '浠樻鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordmodify']['receiver'] = { ['title'] = 'receiver' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordmodify']['payer'] = { ['title'] = '浠樻浜猴紝鍙互鎵嬪～' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordmodify']['handler_uid'] = { ['title'] = 'handler_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['voucher'] = { ['title'] = '鍑瘉鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '255' }	
  self.action['cgftraderecordmodify']['status'] = { ['title'] = '1琛ㄧず鏈彈鐞嗭紝2琛ㄧず宸插彈鐞?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '1' }	
  self.action['cgftraderecordmodify']['assignee_uid'] = { ['title'] = 'assignee_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordmodify']['account_before_money'] = { ['title'] = '涓婃浠樻閲戦' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '18' }	
  self.action['cgftraderecordmodify']['fill_time'] = { ['title'] = '鍒涘缓鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordmodify']['accepter'] = { ['title'] = '鎽樿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }
  self.action['cgftraderecordmodify']['list_source'] = { ['title'] = '' ,['t'] = 's' , ['max'] = 50 }
	
	-----------------------------
	self.action['cgftraderecorddetail'] = {} 	
	-------
	self.op['cgftraderecorddetail'] = function(postparam,ui)
	
		local net = GmBase.czynet.get_instance()		
		local newpostparam = {}
		local tbname,callbackey,newpostparam = net:cgftraderecorddetail()
		for a,b in pairs(top.action['cgftraderecorddetail']) do
			if postparam[a] ~= nil then
				newpostparam[a] = postparam[a]
			end
		end
		net:add_callback(callbackey,ui)	
		local tb,callbackey = net:cgftraderecorddetail(newpostparam)
		
	end	
		
  self.action['cgftraderecorddetail']['id'] = { ['title'] = '编号' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['trade_code'] = { ['title'] = '璐㈠姟娴佹按璐︾紪鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorddetail']['customer_id'] = { ['title'] = 'customer_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['user_id'] = { ['title'] = 'user_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['supplier_id'] = { ['title'] = 'supplier_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['finance_order_group_id'] = { ['title'] = 'finance_order_group_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['sell_id'] = { ['title'] = '鏉愭枡閿€鍞叧鑱?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['purchase_id'] = { ['title'] = '閲囪喘妯″潡-閲囪喘鍗昳d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['purchase_order_id'] = { ['title'] = '閽堝閲囪喘璁㈠崟鐨勪粯娆?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['record_group_id'] = { ['title'] = '浠撳簱鎵归噺鎿嶄綔缁刬d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['last_money_account'] = { ['title'] = '閾惰璐﹀彿鏈熷垵' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorddetail']['money'] = { ['title'] = 'money' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorddetail']['next_money_account'] = { ['title'] = '閾惰璐︽埛鏈熸湯' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecorddetail']['discount'] = { ['title'] = '鎶樻墸' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorddetail']['preferential'] = { ['title'] = '浼樻儬' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorddetail']['is_from_customer_account'] = { ['title'] = 'is_from_customer_account' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecorddetail']['is_recharge'] = { ['title'] = '鏄惁鏄厖鍊艰褰?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecorddetail']['money_name'] = { ['title'] = 'money_name' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorddetail']['money_type'] = { ['title'] = 'in:鍏ヨ处锛沷ut:鍑鸿处锛泃ransfer:杞处锛?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecorddetail']['money_project_id'] = { ['title'] = '鐢ㄤ簬鍏朵粬鏀跺叆鏀嚭鍒嗙被' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['system_account_id'] = { ['title'] = 'system_account_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['create_time'] = { ['title'] = '浠樻鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorddetail']['receiver'] = { ['title'] = 'receiver' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecorddetail']['payer'] = { ['title'] = '浠樻浜猴紝鍙互鎵嬪～' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecorddetail']['handler_uid'] = { ['title'] = 'handler_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['voucher'] = { ['title'] = '鍑瘉鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '255' }	
  self.action['cgftraderecorddetail']['status'] = { ['title'] = '1琛ㄧず鏈彈鐞嗭紝2琛ㄧず宸插彈鐞?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '1' }	
  self.action['cgftraderecorddetail']['assignee_uid'] = { ['title'] = 'assignee_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecorddetail']['account_before_money'] = { ['title'] = '涓婃浠樻閲戦' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '18' }	
  self.action['cgftraderecorddetail']['fill_time'] = { ['title'] = '鍒涘缓鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecorddetail']['accepter'] = { ['title'] = '鎽樿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }
  self.action['cgftraderecorddetail']['list_source'] = { ['title'] = '' ,['t'] = 's' , ['max'] = 50 }
	
	-----------------------------
	self.action['cgftraderecordlist'] = {} 	
	-------
	self.op['cgftraderecordlist'] = function(postparam,ui)
	
		local net = GmBase.czynet.get_instance()		
		local newpostparam = {}
		local tbname,callbackey,newpostparam = net:cgftraderecordlist()
		for a,b in pairs(top.action['cgftraderecordlist']) do
			if postparam[a] ~= nil then
				newpostparam[a] = postparam[a]
			end
		end
		net:add_callback(callbackey,ui)	
		local tb,callbackey = net:cgftraderecordlist(newpostparam)
		
	end	
		
  self.action['cgftraderecordlist']['id'] = { ['title'] = '编号' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['trade_code'] = { ['title'] = '璐㈠姟娴佹按璐︾紪鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordlist']['customer_id'] = { ['title'] = 'customer_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['user_id'] = { ['title'] = 'user_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['supplier_id'] = { ['title'] = 'supplier_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['finance_order_group_id'] = { ['title'] = 'finance_order_group_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['sell_id'] = { ['title'] = '鏉愭枡閿€鍞叧鑱?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['purchase_id'] = { ['title'] = '閲囪喘妯″潡-閲囪喘鍗昳d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['purchase_order_id'] = { ['title'] = '閽堝閲囪喘璁㈠崟鐨勪粯娆?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['record_group_id'] = { ['title'] = '浠撳簱鎵归噺鎿嶄綔缁刬d' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['last_money_account'] = { ['title'] = '閾惰璐﹀彿鏈熷垵' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordlist']['money'] = { ['title'] = 'money' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordlist']['next_money_account'] = { ['title'] = '閾惰璐︽埛鏈熸湯' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '19' }	
  self.action['cgftraderecordlist']['discount'] = { ['title'] = '鎶樻墸' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordlist']['preferential'] = { ['title'] = '浼樻儬' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordlist']['is_from_customer_account'] = { ['title'] = 'is_from_customer_account' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordlist']['is_recharge'] = { ['title'] = '鏄惁鏄厖鍊艰褰?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '2' }	
  self.action['cgftraderecordlist']['money_name'] = { ['title'] = 'money_name' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordlist']['money_type'] = { ['title'] = 'in:鍏ヨ处锛沷ut:鍑鸿处锛泃ransfer:杞处锛?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '64' }	
  self.action['cgftraderecordlist']['money_project_id'] = { ['title'] = '鐢ㄤ簬鍏朵粬鏀跺叆鏀嚭鍒嗙被' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['system_account_id'] = { ['title'] = 'system_account_id' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['create_time'] = { ['title'] = '浠樻鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordlist']['receiver'] = { ['title'] = 'receiver' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordlist']['payer'] = { ['title'] = '浠樻浜猴紝鍙互鎵嬪～' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '32' }	
  self.action['cgftraderecordlist']['handler_uid'] = { ['title'] = 'handler_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['voucher'] = { ['title'] = '鍑瘉鍙?' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '255' }	
  self.action['cgftraderecordlist']['status'] = { ['title'] = '1琛ㄧず鏈彈鐞嗭紝2琛ㄧず宸插彈鐞?' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '1' }	
  self.action['cgftraderecordlist']['assignee_uid'] = { ['title'] = 'assignee_uid' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '11' }	
  self.action['cgftraderecordlist']['account_before_money'] = { ['title'] = '涓婃浠樻閲戦' , ['t'] = 'n' , ['min'] = 'NaN' , ['max'] = '18' }	
  self.action['cgftraderecordlist']['fill_time'] = { ['title'] = '鍒涘缓鏃堕棿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }	
  self.action['cgftraderecordlist']['accepter'] = { ['title'] = '鎽樿' , ['t'] = 's' , ['min'] = 'NaN' , ['max'] = '20' }
  self.action['cgftraderecordlist']['list_source'] = { ['title'] = '' ,['t'] = 's' , ['max'] = 50 }
	
  
 
  	
  
	self.session = {}
	
end   





mcgftraderecordmgr.check_fields_validate = function(self,key,postparam)
	local checkfunc = {}
	checkfunc['t'] = function(fm,value)
		return true
	end
	checkfunc['min'] = function(fm,value)
		if string.len(value) < tonumber(fm) then
			return false
		end
		return true
	end
	checkfunc['max'] = function(fm,value)
		if string.len(value) > tonumber(fm) then
			return false
		end
		return true
	end
	local format = self.action[key]
	for fkey,fvalue in pairs(postparam) do
		if format[fkey] ~= nil then
			for fmkey,fmvalue in pairs(format[fkey]) do
				if checkfunc[fmkey] ~= nil then
					if checkfunc[fmkey](fmvalue,fvalue) == false then
						return false,tostring(format[fkey]['title']).." "..tostring(fmkey).." "..tostring(fmvalue).." error"
					end
				end
			end
		end
	end
	return true,""
end 


 
mcgftraderecordmgr.get_session = function(self,key)
	if key == nil then
		key = 'default'
	end
	return self.session[key]
end

mcgftraderecordmgr.has_session = function(self,key)
	if key == nil then
		key = 'default'
	end
	return self.session[key] ~= nil
end
 
 
mcgftraderecordmgr.add_session = function(self,key,ses)
	self.session[key] = ses
end


mcgftraderecordmgr.add_ui = function(self,key,ui)
	self.uis[key] = ui
end




-- todo
mcgftraderecordmgr.run = function(self,key,ui)
	if self.action[key] ~= nil and self.op[key] ~= nil then
		local tb = {}
		for k,v in pairs(self.action[key]) do
			if ui[k] ~= nil and type(ui[k]) == 'table' and ui[k].get_text then
				tb[k] = ui[k]:get_text()
			else
				print('run error',key,k)
			end
		end
		local success,msg = self:check_fields_validate(key,tb)
		if success then
			self.op[key](tb,ui)
		else
			ui.hostWindow:showMsg(msg)
		end		
	else
		print('run error self.action',key)
	end
end


------------------------------------------------------------------------------------


mcgftraderecordmgr.get_net_page = function(self,netmethon,attrs)
	local top = self	
	local discuz = GmBase.net.get_instance()
	local methon = netmethon
	if methon ~= nil and discuz[methon] then
		print('mcgftraderecordmgr.get_net_page ',methon)
		local tbname,callbackey,tb = discuz[netmethon](discuz)
		for k,v in pairs(attrs) do
			tb[k] = attrs[k]
		end
		discuz[netmethon](discuz,tb)
	else
		print('mcgftraderecordmgr.get_net_page error ',methon)
	end		
end




mcgftraderecordmgr.get_prev_page = function(self,ui,callback)
	if ui.page ~= nil and type(ui.page) == 'number' then
		local uiattrs = ui:GetAttrs()
		local attrs = {}
		for a,b in pairs(self.action['cgftraderecordlist']) do
			if type(uiattrs[a]) ~= nil then
				attrs[a] = uiattrs[a]
			end
		end
		attrs.page = ui.page - 1		

		if attrs.page < 1 then
			attrs.page = 1
		end

		self:get_net_page(ui.netmethon,attrs)
	end
end


mcgftraderecordmgr.get_next_page = function(self,ui,callback)
	if ui.page ~= nil and type(ui.page) == 'number' then
		local uiattrs = ui:GetAttrs()
		local attrs = {}
		for a,b in pairs(self.action['cgftraderecordlist']) do
			if type(uiattrs[a]) ~= nil then
				attrs[a] = uiattrs[a]
			end
		end
		attrs.page = ui.page + 1
		self:get_net_page(ui.netmethon,attrs)
	end
end

------------------------------------------------------------------------------------



mcgftraderecordmgr.init_table = function(self)
	--[[
	local tablefield = {}
	
	--number
	tablefield['id'] = { ["i"] = 11, }
    
	--string
	tablefield['trade_code'] = { ["v"] = 64, }
    
	--number
	tablefield['customer_id'] = { ["i"] = 11, }
    
	--number
	tablefield['user_id'] = { ["i"] = 11, }
    
	--number
	tablefield['supplier_id'] = { ["i"] = 11, }
    
	--number
	tablefield['finance_order_group_id'] = { ["i"] = 11, }
    
	--number
	tablefield['sell_id'] = { ["i"] = 11, }
    
	--number
	tablefield['purchase_id'] = { ["i"] = 11, }
    
	--number
	tablefield['purchase_order_id'] = { ["i"] = 11, }
    
	--number
	tablefield['record_group_id'] = { ["i"] = 11, }
    
	--number
	tablefield['last_money_account'] = { ["i"] = 19, }
    
	--number
	tablefield['money'] = { ["i"] = 19, }
    
	--number
	tablefield['next_money_account'] = { ["i"] = 19, }
    
	--string
	tablefield['discount'] = { ["v"] = 20, }
    
	--string
	tablefield['preferential'] = { ["v"] = 20, }
    
	--number
	tablefield['is_from_customer_account'] = { ["i"] = 2, }
    
	--number
	tablefield['is_recharge'] = { ["i"] = 2, }
    
	--string
	tablefield['money_name'] = { ["v"] = 64, }
    
	--string
	tablefield['money_type'] = { ["v"] = 64, }
    
	--number
	tablefield['money_project_id'] = { ["i"] = 11, }
    
	--number
	tablefield['system_account_id'] = { ["i"] = 11, }
    
	--string
	tablefield['create_time'] = { ["v"] = 20, }
    
	--string
	tablefield['receiver'] = { ["v"] = 32, }
    
	--string
	tablefield['payer'] = { ["v"] = 32, }
    
	--number
	tablefield['handler_uid'] = { ["i"] = 11, }
    
	--string
	tablefield['voucher'] = { ["v"] = 255, }
    
	--number
	tablefield['status'] = { ["i"] = 1, }
    
	--number
	tablefield['assignee_uid'] = { ["i"] = 11, }
    
	--number
	tablefield['account_before_money'] = { ["i"] = 18, }
    
	--string
	tablefield['fill_time'] = { ["v"] = 20, }
    
	--string
	tablefield['accepter'] = { ["v"] = 20, }
    
	self:create_table( self.tablename, tablefield)
	]]
	self:initTableStruct()
end


	